#!/bin/bash

compile() {
	echo "Compiling java-files..."
	javac -Xlint:unchecked -classpath ./bin -d ./bin src/main/*.java
	javac -Xlint:unchecked -classpath ./bin -d ./bin src/worker/*.java
	echo
	echo "Creating jar-file..."
	jar cmf  manifest.txt ${1}.jar -C ./bin main
	jar uf  ${1}.jar -C ./bin worker
	echo
	echo "enjoy!"
}

echo "NP partition shell script..."
echo
echo

if [ -z "$1" ]; 
then 
	echo "usage: ${0} compile filename - compiles java and creates jar"
	echo "example: './${0} compile np'  -> output: np.jar"
	exit
fi

if [ "${1}" = "compile" ]; 
then

	compile ${2}
	
fi
